<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>移动端视口</title>
</head>
<body>
    <script>
        //获取布局视口的大小  //了解
        console.log(document.documentElement.clientWidth);  
            
        //如是是 ios 设备  //了解
        console.log(window.innerWidth);
        //如果是 android 设备
        console.log(window.visualViewport.width);
    </script>
</body>
</html>